package edu.columbia.aicheckers;

import edu.columbia.aicheckers.agent.*;
import edu.columbia.aicheckers.model.Color;

public class Driver {
	
	private static final int TOTAL_GAMES = 100;

	public static void main(String[] args) {
		
		int numWhiteWins = 0;
		int numBlackWins = 0;
		/*
		CheckerGame game = new CheckerGame(new IntelliAgent(), new MinimaxAgent(1));
		
		game.setPrintDebugInfo(true);
		Color winner = game.start();
		if (winner == Color.White)
		{
			System.out.println("White wins");
		}
		else
		{
			System.out.println("Black wins");
		}
	*/
		
 
		for(int i = 0;i < TOTAL_GAMES; i++)
		{
			CheckerGame game = new CheckerGame(new RuleBasedAgent(), new MinimaxAgent(4));
			game.setPrintDebugInfo(false);
			Color winner = game.start();
			if(winner == Color.White)
				numWhiteWins++;
			else if(winner == Color.Black)
				numBlackWins++;
			System.out.println(i + " Game Ended");
			System.out.println("White wins: " + numWhiteWins);
			System.out.println("Black wins: " + numBlackWins);
		}
		
		System.out.println("% White wins: " + 100.0*((double)numWhiteWins/(double)TOTAL_GAMES));

		System.out.println("% Black wins: " + 100.0*((double)numBlackWins/(double)TOTAL_GAMES));

		
	}

}
